import Home from '@/views/Home'
import DtFooter from '@/components/DtFooter'

const Shop = () => import('@/views/Shop')
const Cart = () => import('@/views/Cart')
const Mine = () => import('@/views/Mine')
const ShopList = () => import('@/components/dtshop/DtShopItems')
const Detail = () => import('@/views/Detail')

export default [
  {
    path: '/',
    redirect: '/home',
    meta: {
      isTabbar: false
    }
  },
  {
    path: '/home',
    name: 'home',
    // component 和 components !!!!!!!!!!!!!!!!!!!!!
    components: {
      default: Home,
      footer: DtFooter
    },
    meta: {
      isTabbar: true,
      title: '首页'
    }
  },
  {
    path: '/shop',
    name: 'shop',
    components: {
      default: Shop,
      footer: DtFooter
    },
    meta: {
      isTabbar: true,
      title: '商城'
    },
    children: [
      {
        path: ':shopid',
        component: ShopList
      }
    ]
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: Cart,
      footer: DtFooter
    },
    meta: {
      isTabbar: true,
      title: '购物车'
    }
  },
  {
    path: '/mine',
    name: 'mine',
    components: {
      default: Mine,
      footer: DtFooter
    },
    meta: {
      isTabbar: true,
      title: '我的'
    }
  },
  {
    path: '/detail',
    name: 'detali',
    component: Detail,
    meta: {
      isTabbar: false
    }
  }
]
